package com.seckill;

import org.mybatis.spring.annotation.MapperScan;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.client.RedisClient;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/*****
 * @Author: http://www.itheima.com
 * @Project: seckill
 * @Description: com.seckill.GoodsApplication
 ****/
@SpringBootApplication
@EnableFeignClients(basePackages = {"com.seckill.*.feign"})
@MapperScan(basePackages = "com.seckill.order.mapper")
@EnableScheduling
@EnableAsync
public class OrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class,args);
    }

    @Bean
    public RedissonClient redisClient(){
        Config config = new Config();
        config.useSingleServer()
                .setAddress("redis://192.168.200.130:6379")
                .setPassword("123456");
        return Redisson.create(config);
    }

}


